{template "header.html"}
<div class="note note-danger">
    <p>模板消息发送对象是已关注本公众号的粉丝</p>
</div>
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="row myfbody">
        <div class="col-md-12">

            <div class="portlet light bordered">
                <div class="portlet-title">
                    <div class="caption">
                        <span class="caption-subject font-green sbold ">{dr_lang('消息信息')}</span>
                    </div>

                    <div class="actions">
                        <div class="btn-group">
                            <a class="btn" href="{$reply_url}"> <i class="fa fa-mail-reply"></i> {dr_lang('返回列表')}</a>
                        </div>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="form-body">

                        <div class="form-group" id="dr_row_title">
                            <label class="col-md-2 control-label ">{dr_lang('主题')}</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" id="dr_title" name="data[title]" value="{$title}">
                                <span class="help-block">在CMS中描述这个消息是干什么的，不会在微信中显示</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label ">{dr_lang('模版ID')}</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control"  name="data[template]" value="{$template}">
                                <span class="help-block">在微信公众号中-功能-模板消息-我的模板：模板ID</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label ">{dr_lang('跳转URL')}</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control"  name="data[url]" value="{$url}">
                                <span class="help-block">在微信公众号中单击这个模板消息的跳转url，需要https://或者http://开头</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label ">{dr_lang('主题颜色')}</label>
                            <div class="col-md-6">
                                <label> <input type="text" class="form-control"  name="data[color]" value="{$color}"></label>
                                <span class="help-block">微信消息主题显示的颜色，例如：红色是#ff0000</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label ">{dr_lang('已发统计')}</label>
                            <div class="col-md-6">
                                <label> <input type="text" class="form-control"  name="data[counts]" value="{$counts}"></label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-xs-2 control-label">接收粉丝</label>
                            <div class="col-xs-8">
                                <div class=" mt-radio-inline">
                                    <label class="mt-radio mt-radio-outline"> 全部粉丝【{$ucount}】
                                        <input type="radio" onclick="$('.is_openid').hide()" value="0" {if !$groupid}checked{/if} name="data[groupid]">
                                        <span></span>
                                    </label>
                                    {loop $group $v}
                                    <label class="mt-radio mt-radio-outline"> {$v.name}【{$v.count}】
                                        <input type="radio" onclick="$('.is_openid').hide()" {if $groupid == $v.tag}checked{/if} value="{$v.tag}" name="data[groupid]">
                                        <span></span>
                                    </label>
                                    {/loop}
                                    {loop $ci->member_cache['group'] $v}
                                    <label class="mt-radio mt-radio-outline"> {$v.name}
                                        <input type="radio" onclick="$('.is_openid').hide()" {if $groupid == -$v.id}checked{/if} value="-{$v.id}" name="data[groupid]">
                                        <span></span>
                                    </label>
                                    {/loop}
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label ">{dr_lang('模板内容参数')}</label>
                            <div class="col-md-9">
                                <table class="table table-mtotal table-nomargin table-bordered table-striped table-bordered table-advance">
                                    <thead>
                                    <tr>
                                        <th width="200">参数名</th>
                                        <th width="200">颜色</th>
                                        <th>参数值</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {php for ($i = 0;$i < 10 ;$i++) { }
                                    <tr>
                                        <td><input type="text" class="form-control" name="data[content][{$i}][name]" value="{$content[$i]['name']}"></td>
                                        <td><input type="text" class="form-control" name="data[content][{$i}][color]" value="{$content[$i]['color']}"></td>

                                        <td>
                                            <textarea class="form-control" style="height:80px" name="data[content][{$i}][value]">{$content[$i]['value']}</textarea>
                                        </td>
                                    </tr>
                                    {php } }
                                    </tbody>
                                </table>
                            </div>
                        </div>

                    </div>
                </div>
            </div>

        </div>

    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">

            <label><button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存内容')}</button></label>
            <label><button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000', '{$reply_url}')" class="btn yellow"> <i class="fa fa-send"></i> {dr_lang('保存并返回')}</button></label>

        </div>
    </div>
</form>


{template "footer.html"}